package com.design.chainofresponsibility;

/**
 * @author leali
 * @title: Manager
 * @projectName design
 * @description: 新的具体处理者类Manager测试
 * @date 2022/1/3 2:04
 */
public class Manager extends Approver {
    public Manager(String name) {
        super(name);
    }

    @Override
    public void processRequest(PurchaseRequest request) {
        if (request.getAmount() < 80000) {
            System.out.println("经理" + this.name + "审批采购单：" + request.getNumber() + "，金额：" + request.getAmount() + "元，采购目的：" + request.getPurpose() + "。");
        } else {
            this.successor.processRequest(request);
        }
    }
}
